package com.rpc.test.client.flow.sub.flow.sub4;

import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import rpc.core.BaseAsyncFlow;
import rpc.core.annotations.Flow;

@Flow("consumerapi.flow2")
public class Flow2 extends BaseAsyncFlow {

  private static AtomicInteger index = new AtomicInteger(0);

  @Override
  public void enter() {
    double millis = new Random().nextDouble() * 1000;
    this.invoke(this::retRes, "producerapi.hi", req.append("millis", millis).append("index", index.incrementAndGet()));
  }
}
